package com.sky.mapper;

import com.sky.entity.User;
import com.sky.vo.UserReportVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.Map;

/**
 * @author 猛在王
 * @version 1.0
 * @date 1/6/2024 下午5:09
 * @description UserMapper
 * @since 1.0
 */
@Mapper
public interface UserMapper {

    /**
     * 通过openid查询用户
     * @param openid
     * @return
     */
    @Select("select * from user where openid = #{openid}")
    User getByOpenid(String openid);

    /**
     * 注册用户
     * @param user
     */
    void insert(User user);

    /**
     * 通过用户id查询
     * @param userId
     * @return
     */
    @Select("select * from user where id = #{userId}")
    User getById(Long userId);

    /**
     * 获取用户数量
     * @param map
     * @return
     */
    Integer getUserCount(Map map);

}
